import React ,{useState} from 'react';
import {NavLink,Outlet} from "react-router-dom";

export default function Home() {
    const [sum,setSum] =useState(1);
    return (
        <div>
            <h3>我是Home内容</h3>
            {/* {
                sum === 2 ? <Navigate to="/about" replace={false} /> : <h4>当前的sum值为：{sum}</h4>
            } */}
            <button onClick={()=>{setSum(2)}}>点我讲sum变成2</button>
            <ul className="nav nav-tabs">
                <li>
                    {/* <a className="list-group-item active" href="./home-news.html">News</a> */}
                    <NavLink className="list-group-item" to="news">News</NavLink>
                </li>
                <li>
                    {/* <a className="list-group-item " href="./home-message.html">Message</a> */}
                    <NavLink className="list-group-item" to="message">Message</NavLink>
                </li>
            </ul>
            <Outlet></Outlet>
        </div>
    )
}
